﻿<telerik:RadWindow x:Class="ProTemplate.UserControls.RadWindows.AddExamination"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
    xmlns:input="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Input"
    xmlns:my="clr-namespace:ProTemplate.UserControls"
    mc:Ignorable="d" Header="新增商检"
    Width="500" Height="300" Style="{StaticResource CommonRadWindowStyle}" telerik:Theming.Theme="Office_Blue" WindowStartupLocation="CenterScreen">
    <telerik:RadWindow.Resources>
        <Style TargetType="TextBlock" x:Key="AddDeclarationLable">
            <Setter Property="VerticalAlignment" Value="Center" />
            <Setter Property="Width" Value="60" />
        </Style>

        <Style TargetType="TextBox" x:Key="AddDeclarationInputBox">
            <Setter Property="VerticalAlignment" Value="Center" />
            <Setter Property="Width" Value="180" />
        </Style>

        <Style TargetType="input:AutoCompleteBox" x:Key="AddDeclarationAutoCompleteBoxStyle">
            <Setter Property="VerticalAlignment" Value="Center" />
            <Setter Property="Width" Value="180" />
        </Style>
    </telerik:RadWindow.Resources>
    
    <Grid x:Name="LayoutRoot" Background="White">
        <Grid.RowDefinitions>
            <RowDefinition Height="40" />
            <RowDefinition Height="*" />
            <RowDefinition Height="30" />
        </Grid.RowDefinitions>
        <my:EditWindowToolBar x:Name="toolBar" Grid.Row="0" SaveAndClose="toolBar_SaveAndClose" SaveAndNew="toolBar_SaveAndNew" Close="toolBar_Close" />

        <Grid Grid.Row="1" Margin="0,10,0, 0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="30" />
                <RowDefinition Height="30" />
                <RowDefinition Height="30" />
                <RowDefinition Height="30" />
                <RowDefinition Height="30" />
                <RowDefinition Height="30" />
            </Grid.RowDefinitions>
            <StackPanel Orientation="Horizontal">
                <TextBlock Text="客户名称：" Style="{StaticResource AddDeclarationLable}" />
                <input:AutoCompleteBox x:Name="acbCustomer" Text="{Binding CustomerName,Mode=TwoWay, ValidatesOnExceptions=True, NotifyOnValidationError=True,UpdateSourceTrigger=Explicit}"
                                                   Style="{StaticResource AddDeclarationAutoCompleteBoxStyle}" FilterMode="None" Populating="acbCustomer_Populating" ValueMemberPath="Name" >
                    <input:AutoCompleteBox.ItemTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding Name}" />
                        </DataTemplate>
                    </input:AutoCompleteBox.ItemTemplate>
                </input:AutoCompleteBox>
            </StackPanel>

            <StackPanel Grid.Column="1" Orientation="Horizontal">
                <TextBlock Text="商检编号：" Style="{StaticResource AddDeclarationLable}" />
                <TextBox x:Name="tbExaminationNumber" MaxLength="32" Style="{StaticResource AddDeclarationInputBox}" Text="{Binding ExaminationNumber,Mode=TwoWay, ValidatesOnExceptions=True, NotifyOnValidationError=True,UpdateSourceTrigger=Explicit}" />
            </StackPanel>

            <StackPanel Grid.Row="1" Grid.Column="0" Orientation="Horizontal">
                <TextBlock Text="商品名称：" Style="{StaticResource AddDeclarationLable}" />
                <TextBox x:Name="tbProductName" MaxLength="32" Style="{StaticResource AddDeclarationInputBox}" Text="{Binding GoodsName,Mode=TwoWay, ValidatesOnExceptions=True, NotifyOnValidationError=True,UpdateSourceTrigger=Explicit}" />
            </StackPanel>

            <StackPanel Grid.Row="1" Grid.Column="1" Orientation="Horizontal">
                <TextBlock Text="金额：" Style="{StaticResource AddDeclarationLable}" />
                <TextBox x:Name="tbAmount" MaxLength="32" Style="{StaticResource AddDeclarationInputBox}" Text="{Binding Amount,Mode=TwoWay, ValidatesOnExceptions=True, NotifyOnValidationError=True,UpdateSourceTrigger=Explicit}" />
            </StackPanel>

            <StackPanel Grid.Row="2" Grid.Column="0" Orientation="Horizontal">
                <TextBlock Text="数量/重量：" Style="{StaticResource AddDeclarationLable}" />
                <TextBox x:Name="tbQuantity" MaxLength="32" Style="{StaticResource AddDeclarationInputBox}" Text="{Binding Quantity, Mode=TwoWay, ValidatesOnExceptions=True, NotifyOnValidationError=True,UpdateSourceTrigger=Explicit}" />
            </StackPanel>

            <StackPanel Grid.Row="2" Grid.Column="1" Orientation="Horizontal">
                <TextBlock Text="转单号：" Style="{StaticResource AddDeclarationLable}" />
                <TextBox x:Name="tbTransferNumber" MaxLength="32" Style="{StaticResource AddDeclarationInputBox}" Text="{Binding TransferNumber}" />
            </StackPanel>


            <StackPanel Grid.Row="3" Grid.Column="0" Orientation="Horizontal">
                <TextBlock Text="密码：" Style="{StaticResource AddDeclarationLable}" />
                <TextBox x:Name="tbPassword" MaxLength="32" Style="{StaticResource AddDeclarationInputBox}" Text="{Binding Password}" />
            </StackPanel>

            <StackPanel Grid.Column="1"  Orientation="Horizontal" Grid.Row="3">
                <TextBlock Text="接收日期：" Style="{StaticResource AddDeclarationLable}" />
                <sdk:DatePicker x:Name="dpReceiveDate"  VerticalAlignment="Center" Width="180" SelectedDate="{Binding ReceivedDate,Mode=TwoWay, ValidatesOnExceptions=True, NotifyOnValidationError=True,UpdateSourceTrigger=Explicit}"  />
            </StackPanel>

            <StackPanel Grid.Row="4" Grid.Column="0" Orientation="Horizontal">
                <TextBlock Text="运编号：" Style="{StaticResource AddDeclarationLable}" />
                <TextBox x:Name="tbRelatedSystemNumber" MaxLength="32" Style="{StaticResource AddDeclarationInputBox}" Text="{Binding RelatedSystemNumber}" />
            </StackPanel>

            <StackPanel Grid.Row="4" Grid.Column="1" Orientation="Horizontal">
                <TextBlock Text="备注：" Style="{StaticResource AddDeclarationLable}" />
                <TextBox x:Name="tbRemark" Style="{StaticResource AddDeclarationInputBox}" Text="{Binding Remark}" />
            </StackPanel>
            <StackPanel Grid.Row="5" Grid.Column="0" Orientation="Horizontal">
                <TextBlock Text="费用：" Style="{StaticResource AddDeclarationLable}" />
                <TextBox x:Name="tbFee" Style="{StaticResource AddDeclarationInputBox}" Text="{Binding ExaminationFee}" />
            </StackPanel>
            <StackPanel Grid.Row="5" Grid.Column="1" Orientation="Horizontal">
                <TextBlock Text="商检成本：" Style="{StaticResource AddDeclarationLable}" />
                <TextBox x:Name="tbExaminationCost" Style="{StaticResource AddDeclarationInputBox}" Text="{Binding ExaminationCost}" />
            </StackPanel>
        </Grid>
        
        <Border x:Name="bdMsgParent" Grid.Row="2" Grid.ColumnSpan="2" HorizontalAlignment="Right" Margin="0,8,10,0"></Border>
        <Border Grid.RowSpan="3">
            <telerik:RadBusyIndicator x:Name="busyIndicator" DisplayAfter="0" IsBusy="False" BusyContent="正在处理，请稍候..." />
        </Border>
    </Grid>
</telerik:RadWindow>
